import random
# V1.0
# x = random.randint(1,100)
# print("输入一个一百以内的随机数：")
# while 0==0:
#   print("输入一个一百以内的随机数：")
#   y = int(input())
#   if x>y:
#     print("小了")
#   elif x<y:
#     print("大了")
#   else:
#     print(f"恭喜猜中，本轮幸运数字：{x}")
#     break

# V2.0
# x = random.randint(1,100)
# mony = 5000
# print("输入一个一百以内的随机数：")
# while mony>0:

#   y = int(input())
#   if x>y:
#     print("小了")
#     mony -= 500
#     print(f"您现在金币为{mony}")
#   elif x<y:
#     print("大了")
#     mony -= 500
#     print(f"您现在金币为{mony}")
#   else:
#     print(f"恭喜猜中，本轮幸运数字：{x}")
#     mony+=3000
#     print(f"您现在金币为{mony}")

#V3.0
x = random.randint(1,100)
mony = 5000
print("输入一个一百以内的随机数：")
while mony>0:
  y = int(input())
  if x>y:
    print("小了")
    mony -= 500
    print(f"您现在金币为{mony}")
  elif x<y:
    print("大了")
    mony -= 500
    print(f"您现在金币为{mony}")
  else:
    print(f"恭喜猜中，本轮幸运数字：{x}")
    mony+=3000
    print(f"您现在金币为{mony}")
    print("是否要继续下一轮游戏?输入1进入新一轮游戏")
    massage = int(input())
    if massage == 1:
      print("新一轮开始，请输入数字：")
      x = random.randint(1, 100)
    else:
      break


